/**
 * Project Name:jiuselu-parent
 * File Name:BannerController.java
 * Package Name:com.fxp.project.jiuselu.web.business.v1.controller.banner
 * Date:2021年11月01日 16:38
 * Copyright (c) 2021, Kai.Wang All Rights Reserved.
 */
package com.fxp.project.jiuselu.web.business.v1.controller.banner;

import com.fxp.project.jiuselu.web.base.controller.BaseController;
import com.fxp.project.jiuselu.web.base.request.ReqBase;
import com.fxp.project.jiuselu.web.business.v1.request.sms.ReqMessage;
import com.fxp.project.jiuselu.web.domain.CommonResult;
import com.fxp.project.jiuselu.web.models.goods.entity.JslBanner;
import com.fxp.project.jiuselu.web.models.goods.service.IJslBannerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.AutoConfigureOrder;
import org.springframework.validation.BindingResult;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * ClassName:BannerController<br/>
 * Function: 首页的Banner<br/>
 * Date:2021年11月01日 16:38<br/>
 *
 * @author Kai.Wang
 * @version 1.0.0
 * @see
 * @since JDK 8
 */
@RestController
@RequestMapping("/v1/banner")
public class BannerController extends BaseController {

    @Autowired
    IJslBannerService jslBannerService;

    /**
     * list: 获取当前需要展示的Banner信息<br/>
     *
     * @param reqBase
     * @param result
     * @return
     * @author Kai.Wang
     * @date 2021/11/1 16:42
     */
    @PostMapping("list")
    @CrossOrigin
    public CommonResult list(@RequestBody @Validated ReqBase reqBase, BindingResult result) {
        super.checkBindResult(result);
        List<JslBanner> list = jslBannerService.selectBannerListByPlatform(reqBase.getPlatform());
        return CommonResult.success(list);
    }
}
